﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CCH.DAO;
using CCH.Entity;

public partial class _1007_1 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //相本封面
        if (Request["sfu_type"] != null && Request["sfu_type"] != "")
        {
            sysfunctionDAO dao = new sysfunctionDAO();
            int sfu_no = dao.Get_pathNO(2004, Request["sfu_type"]);

            //標題名稱 <a href="">首頁</a><img src="css/tem/img/img-icon-4.jpg" width="5" height="7" />最新消息
            this.nav.InnerHtml = "";
            string imgStr = "<img src=\"css/tem/img/img-icon-4.jpg\" width=\"5\" height=\"7\" />";
            string[] sfu_name = dao.Get_titleName(sfu_no).Split('/');

            if (sfu_name[0].Trim() == sfu_name[1].Trim())
            {
                this.nav.InnerHtml = string.Format("<a href=\"#\">首頁</a>{0}<a href=\"#\">{1}</a>", imgStr, sfu_name[1].Trim());
            }
            else
            {
                this.nav.InnerHtml = string.Format("<a href=\"#\">首頁</a>{0}<a href=\"#\">{1}</a>{2}<a href=\"#\">{3}</a>", imgStr, sfu_name[0].Trim(), imgStr, sfu_name[1].Trim());
            }

            this.lab_title2.Text = sfu_name[1].Trim();
        }

        //相本照片
        if (Request["alb_no"] != null && Request["alb_no"] != "")
        {
            List<photo> data = new albumDAO().Get_photo_AllData(int.Parse(Request["alb_no"])).ToList();

            this.div_item.InnerHtml = "";
            this.div_item.InnerHtml += "<ul>";
            if (data.Count > 0)
            {
                foreach (var d in data)
                {
                    string str = string.Format("<li><a href=\"#\"><img src=\"1007-2.ashx?alb_no={0}&pho_no={1}&type=1\" data-large=\"1007-2.ashx?alb_no={0}&pho_no={1}&type=2\" data-description=\"{2}\" /></a></li>", Request["alb_no"], d.pho_no, d.pho_desc);
                    this.div_item.InnerHtml += str;
                }
            }
            else
            {
                this.div_item.InnerHtml += "<li><a href=\"#\"><img src=\"images/noimage2.jpg\" data-large=\"images/noimage.jpg\" data-description=\"沒有相片\" /></a></li>";
            }

            //this.div_item.InnerHtml += "<li><a href=\"#\"><img src=\"css/gallery/images/thumbs/1.jpg\" data-large=\"css/gallery/images/1.jpg\" alt=\"image01\" data-description=\"From off a hill whose concave womb reworded\" /></a></li>";
            //this.div_item.InnerHtml += "<li><a href=\"#\"><img src=\"css/gallery/images/thumbs/2.jpg\" data-large=\"css/gallery/images/2.jpg\" alt=\"image02\" data-description=\"A plaintful story from a sistering vale\" /></a></li>";

            this.div_item.InnerHtml += "<ul>";

        }
    }
}